import { Entity, PrimaryColumn, Column } from "typeorm";
import { ManualTimestamp } from "../decorators/manual-timestamp.decorator";

/**
 * 升级等级经验表
 * 存储每个等级对应的经验值
 */
@Entity("level_experience")
@ManualTimestamp()
export class LevelExperienceEntity {
  /**
   * 等级 (主键)
   */
  @PrimaryColumn({ type: "int", comment: "等级" })
  level!: number;

  /**
   * 该等级需要的总经验值
   */
  @Column({ type: "bigint", comment: "该等级需要的总经验值" })
  experience!: number;

  /**
   * 每次标准战斗获得的经验（由文档10小时训练经验反推）
   */
  @Column({ type: "int", nullable: true, comment: "每次标准战斗获得的经验" })
  standard_exp_per_fight?: number;

  /**
   * 创建时间
   */
  @Column("datetime", { comment: "创建时间" })
  created_at!: Date;

  /**
   * 更新时间
   */
  @Column("datetime", { comment: "更新时间" })
  updated_at!: Date;
}
